JavaScript

Core Libraries

Description

Basic JavaScript functions in Alpha Anywhere's core libraries

Discussion

The following JavaScript libraries are in the core.js library that ships with Alpha Anywhere. All of the functions below are in the core.js library. These functions are useful if you are writing hand-coded Ajax applications or if you are writing JavaScript event handlers in the built-in components.

In the case of the built-in components (e.g. the Grid), the core.js library is automatically included in your pages and there is no need for you to specify a link to the library. For pages that you write yourself, you can link the library into your page as follows:

<script type="text/Javascript" src="Javascript/core.js"></script>
Name
Description
Array and Object Functions

Core functions for working with JavaScript arrays and objects.

Date Functions

Alpha Anywhere extends the JavaScript Date object with several methods.

Event Functions

The core JavaScript library provides several functions for adding and removing events from objects.

Generic Utility Functions

Utility JavaScript functions.

Getting Elements Functions

The following JavaScript functions can be used to get pointers to elements in an HTML document.

Number Functions

Utility JavaScript functions for working with numbers.

Position, Size, and Scrolling Functions

The JavaScript functions listed below make it easier to scroll to, position, and size elements in the HTML.

Reserved $ Variables

The Alpha Anywhere JavaScript library contains several reserved variables that begin with a $, including $ which is shorthand for document.getElementById (not jQuery).

String Functions

Utility functions for working with JavaScript strings.

Getting and Setting Styles and Class Names

The JavaScript functions below provide an easy way to get and set the in-line style, can class of HTML elements. The passed in argument of "ELEMENT" can be a pointer to an HTML element, or the ID or NAME of an HTML element. The functions will automatically fetch the element if you pass in an ID or NAME.

Using Core Libraries in Components

The following best practices should be used when using core library functions in components.

Getting and Setting Values and Attributes

The following JavaScript functions can be used to get and set attributes and values of HTML elements. The ELEMENT argument that is passed in can in all cases be a pointer to an HTML element, or the ID or NAME of an HTML element.